/*
Exercises
    2. Examine the following program. Imagine entering three numbers, and write what output you expect. 

1: #include <iostream.h>
2: int main()
3: { 4: int a, b, c;
5: cout << "Please enter three numbers\n";
6: cout << "a: ";
7: cin >> a;
8: cout << "\nb: ";
9: cin >> b;
10: cout << "\nc: ";
11: cin >> c;
12:
13: if (c = (a-b))
14: {cout << "a: ";
15: cout << a;
16: cout << "minus b: ";
17: cout << b;
18: cout << "equals c: ";
19: cout << c << endl;}
20: else
21: cout << "a-b does not equal c: " << endl;
22: return 0;
23: }

    3. Enter the program from Exercise 2; compile, link, and run it. Enter the numbers 20, 10, and 50. Did you get the output you expected? Why not?
*/
#include <iostream.h>

int main(){
	int a, b, c;
	cout << "Please enter three numbers\n";
	cout << "a: ";
	cin >> a;
	cout << "\nb: ";
	cin >> b;
	cout << "\nc: ";
	cin >> c;
	
	if (c == (a-b)){   // Fixed bug here. In original, the comparison operator was an assignment operator
		cout << "a: " << a << " minus b: " << b << " equals c: " << c << endl;
	} else {
		cout << "a - b does not equal c: " << endl;
	}
	return 0;
}
